<?php
session_start();
$query = "SELECT `activ` FROM `modules` WHERE `name`='HTML'";
$sql = mysql_query($query) or die(mysql_error());
$itm = mysql_fetch_row($sql);
$activ=$itm[0];
if($activ==1)
{
  function getBlock($id)
  {
    $query = "SELECT * FROM `modules_html` WHERE `id`='{$id}' LIMIT 1";
    $sql = mysql_query($query) or die(mysql_error());
    $tablerows = mysql_fetch_row($sql);
    if($tablerows[3]==1)
      echo "<h3>$tablerows[1]</h3>";
    echo $tablerows[2];
  }
}
else
{
  function getBlock($id)
  {
      echo"";
  }
}
?>